<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>     
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<link rel="stylesheet" href="${host_url}/css/app/common.css">
<link rel="stylesheet"  href="${host_url}/css/app/become_member.css">
<link rel="stylesheet" href="${host_url}/css/app/swiper.min.css">
<script src="${host_url}/js/app/jquery.min.js"></script>

<script src="${host_url}/js/app/swiper.min.js"></script>
<!-- <link rel="stylesheet" href="/css/app/common.css"> 
<link rel="stylesheet"  href="/css/app/become_member.css">
<link rel="stylesheet" href="/css/app/swiper.min.css">
<script src="/js/app/swiper.min.js"></script> -->
<title>会员升级</title>
<script type="text/javascript">	
/*跳往商品详情*/
function fn_goGoodDetail(good_id) {
	window.webkit.messageHandlers.ios_open_page.postMessage('ProductDetailViewController:::goodId->'+good_id);	
}
/*普通和高级会员 会员升级*/  
function fn_getMember(){
	window.webkit.messageHandlers.ios_open_page.postMessage('WKViewController:::url->${levelupinfo_url}:::webTitle->会员升级:::isRefresh->YES');
}
/*去登陆页面*/  
function fn_gologin(){
	window.webkit.messageHandlers.ios_showlogin.postMessage('');
}
/*友米乐会员专享*/
function fn_goExclusiveMembership() {
	window.webkit.messageHandlers.ios_open_page.postMessage('WKViewController:::url->${exclusiveMembership_url}:::webTitle->${app_name}会员专享:::isRefresh->YES');
	
}
$(function(){
	if('${os}'=='android'){
		android.setShareButton('${shareVO.title}','${shareVO.content}','${shareVO.url}','${shareVO.image}','0')
	}
	if('${os}'=='ios'){
		var shareInfo = JSON.stringify({"title":$("#title").val(), "content":$("#content").val(), "url": $("#url").val(),"share_type": '0', "image":$("#image").val()});
		window.webkit.messageHandlers.ios_add_share.postMessage(shareInfo);	
		}
 });
</script>
</head>
<body>
	<input type="hidden" id="title" value="${shareVO.title}" />
	<input type="hidden" id="content" value="${shareVO.content}" />
	<input type="hidden" id="url" value="${shareVO.url}" />
	<input type="hidden" id="image" value="${shareVO.image}" />
	<div class="main">
		<div class="btn_top-wrap">
	      <img src="${host_url}/img/become_top_bg.png" alt="" style="width:100%;" class="btn_top">
		    <c:if test="${'ios'==os}">
				<c:if test="${member_id!=0}">
					<button  onclick="fn_getMember()" style="padding:0;margin:0 !important;"><img src="${host_url}/img/btn_open.png" alt=""></button>
				</c:if>
				<c:if test="${member_id==0}">
					<button onclick="fn_gologin()" style="padding:0;margin:0 !important;"><img src="${host_url}/img/btn_open.png" alt=""></button>
				</c:if>
			</c:if>
			<c:if test="${'wechat'==os ||'web'==os}">
					<button style="padding:0;margin:0 !important;"><img id='{"name":"toLevelUpBtn"}' src="${host_url}/img/btn_open.png" alt=""></button>
			</c:if>
			<c:if test="${'android'==os}">
				<c:if test="${member_id!=0}">
					<button  onclick="android.startUrl('会员升级','${levelupinfo_url}')" style="padding:0;margin:0 !important;"><img src="${host_url}/img/btn_open.png" alt=""></button>
				</c:if>
				<c:if test="${member_id==0}">
					<button onclick="android.toLogin()" style="padding:0;margin:0 !important;"><img src="${host_url}/img/btn_open.png" alt=""></button>
				</c:if>
			</c:if>
	    </div>
		<div class="goods-list-wrap">
			<h4 class="title title-common">
				<p>会员专享价</p>
				<p>VIP会员 专享特卖</p>
			</h4>	
			<div class="goods-list-wrap">
				<div class="goods-list">
					<c:forEach items="${goodList_d}" var="s">
						<c:if test="${'ios'==os}">
							<div onclick="fn_goGoodDetail(${s.good_id})">
						</c:if>
			      		<c:if test="${'android'==os}">
							<div onclick="android.startGoodsDetail(${s.good_id})">
						</c:if>
			      		<c:if test="${'wechat'==os ||'web'==os}">
							<div id='{"name":"goGoodsDetail", "params": {"level":${s.good_id}}}'>
						</c:if>
								<p><img src="${s.img}" alt=""></p>
								<p class="goods-name">${s.name}</p>
								<p class="price">友米价 &yen;${s.default_price}</p>
								<c:if test="${s.ticket!=0}">
									<p class="vip-price">&yen;${s.member_price}<img src="${host_url}/img/icon_member.png" alt=""></p>
								</c:if>
								<c:if test="${s.ticket==0}">
									<p class="vip-price">&yen;${s.default_price}<img src="${host_url}/img/icon_member.png" alt=""></p>
								
								</c:if>
								
							</div>
					</c:forEach> 
				</div>
				<c:if test="${'ios'==os}"> 
					<h4 class="more" onclick="fn_goExclusiveMembership()"><a>查看全部<img src="${host_url}/img/icon_more.png" alt="" style="width:16px;vertical-align: sub;margin-left:5px;"></a></h4>
				</c:if>
			    <c:if test="${'android'==os}">
					<h4 class="more" onclick="android.startUrl('${app_name}会员专享','${exclusiveMembership_url}')"><a href="javascript:">查看全部<img src="${host_url}/img/icon_more.png" alt="" style="width:16px;vertical-align: sub;margin-left:5px;"></a></h4>
				</c:if>
			    <c:if test="${'wechat'==os ||'web'==os}">
					<div class="more" id='{"name":"toExclusiveMembership"}'>查看全部<img src="${host_url}/img/icon_more.png" alt="" style="width:16px;vertical-align: sub;margin-left:5px;"></div>
				</c:if> 
			</div>	
			<div class="member-list">
				<h4 class="title-1 title-common">
					<p style="padding:0 0 3px;">会员分享赚</p>
					<p>海量商品&nbsp;分享即赚</p>
				</h4>
				<div class="flex-layout">
					<p><img src="${host_url}/img/banner_2.png" alt=""></p>
				</div>
				<h4 class="title-2"><span>看看厉害的会员们${month_s}月赚了多少钱</span></h4>
				<c:forEach items="${super_buvers}" var="s">
					<div class="flex-layout vip-list">
						<p><img src="${s.logo}" alt=""></p>
						<p>${s.name}</p>
						<p>${s.cash}元</p>
					</div>
				</c:forEach>
			</div>
			<div class="serve">
				<h4 class="title title-common">
					<p>售后无忧</p>
					<p>专享客服&nbsp;急速退款</p>
				</h4>
				<div class="flex-layout">
					<div>
						<img src="${host_url}/img/icon_serve_0.png" alt="">
						<p>客服优先通道</p>
						<p>提供专业解答和优质服务</p>
					</div>
					<div>
						<img src="${host_url}/img/icon_serve.png" alt="">
						<p>售后优先处理</p>
						<p>缩短退款时长</p>
					</div>
				</div>
			</div>
			<c:if test="${'ios'==os}">
				<c:if test="${member_id!=0}">
					<button class="btn-open-vip" onclick="fn_getMember()"><span>开通会员特权</span></button>
				</c:if>
				<c:if test="${member_id==0}">
					<button class="btn-open-vip" onclick="fn_gologin()"><span>开通会员特权</span></button>
				</c:if>
			</c:if>
			<c:if test="${'wechat'==os ||'web'==os}">
				<button class="btn-open-vip" id='{"name":"toLevelUpBtn"}'><span>开通会员特权</span></button>
			</c:if>
			<c:if test="${'android'==os}">
				<c:if test="${member_id!=0}">
					<button class="btn-open-vip"  onclick="android.startUrl('会员升级','${levelupinfo_url}')"><span>开通会员特权</span></button>
				</c:if>
				<c:if test="${member_id==0}">
					<button class="btn-open-vip"  onclick="android.toLogin()"><span>开通会员特权</span></button>
				</c:if>
			</c:if>
		</div>
	</div>
	
	<script type="text/javascript">
    $(window).load(function() {
      var nav = $('.main .btn_top');
      var imhHeight = $('.main .btn_top').height();
      var navTop = nav.offset().top;
      $(window).scroll(function () {
        var winTop = $(this).scrollTop();
        if (winTop >= navTop + imhHeight) {
          $('.btn-open-vip').addClass('fixed')
        } else{
          $('.btn-open-vip').removeClass('fixed')
        }
      });
    });
  </script>
</body>
</html>